home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / HTBCalendar / YMSelector.h < prev   
Encoding:
C/C++ Source or Header  |  2005-03-02  |  3.6 KB  |  144 lines

  1. /**********************************************
  2. HTBCALENDAR.DLL
  3. TransEra Corporation 1999.
  4. This is the source for the HTBCalendar Dll.
  5. Class derived from Shekar Narayanan
  6. ***********************************************/
  7.  
  8. #if !defined(AFX_YMSELECTOR_H__12C342F1_008C_11D2_AECD_0004AC31E75C__INCLUDED_)
  9. #define AFX_YMSELECTOR_H__12C342F1_008C_11D2_AECD_0004AC31E75C__INCLUDED_
  10.  
  11. #if _MSC_VER >= 1000
  12. #pragma once
  13. #endif // _MSC_VER >= 1000
  14. // YMSelector.h : header file
  15. //
  16.  
  17. #define     START_YEAR            1583
  18. #define     SIMPLE_STYLE          0
  19. #define     TRADITIONAL_STYLE     1
  20. #define     YM_SELECTED           WM_USER + 50
  21. #define     YM_ABORTED            WM_USER + 51
  22. #define        FONT_SIZE                80
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CYMPopUp window
  26. // Used by the YMSelector control
  27.  
  28. class CYMPopUp : public CWnd
  29. {
  30. // Construction
  31. public:
  32.     CYMPopUp(CPoint p, CWnd* pParent, int nYear = -1, int nMonth = -1, int nDate = -1);
  33.  
  34. // Attributes
  35. public:
  36.  
  37. // Operations
  38. public:
  39.     BOOL Create(CPoint p, CWnd* pParent);
  40.     long julday (int mm, int id, int iyyy);
  41.     int  FDOM ();
  42.     BOOL ValidClick (CPoint point);
  43.     void NextMonth ();
  44.     void PreviousMonth ();
  45.     void PreviousDay();
  46.     void NextDay();
  47.     BOOL LeapYear ();
  48.     int GetDaysinMonth();
  49.  
  50. // Overrides
  51.     // ClassWizard generated virtual function overrides
  52.     //{{AFX_VIRTUAL(CYMPopUp)
  53.     //}}AFX_VIRTUAL
  54.  
  55. // Implementation
  56. public:
  57.     virtual ~CYMPopUp();
  58.  
  59.     // Generated message map functions
  60. protected:
  61.     int     m_nYear;
  62.     int     m_nMonth;
  63.     int        m_nDate;
  64.     CBrush  m_bkBrush;
  65.     CWnd*   m_pParent;
  66.     CRect   m_rCells[31];
  67.     CRect   m_rMinus;
  68.     CRect   m_rPlus;
  69.     CRect   m_rYear;
  70.     short   nCellHeight;
  71.     short   nCellWidth;
  72.     int     nRows, nColumns, nMargins, nStyle;
  73.  
  74.     //{{AFX_MSG(CYMPopUp)
  75.     afx_msg void OnNcDestroy();
  76.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  77.     afx_msg void OnPaint();
  78.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  79.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  80.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  81.     //}}AFX_MSG
  82.     DECLARE_MESSAGE_MAP()
  83. };
  84.  
  85. /////////////////////////////////////////////////////////////////////////////
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CYMSelector window
  89.  
  90. class CYMSelector : public CButton
  91. {
  92. // Construction
  93. public:
  94.     CYMSelector();
  95.  
  96. // Attributes
  97. public:
  98.  
  99.     void    SetYear(int y);
  100.     void    SetMonth(int m);
  101.     void    SetDate(int m);
  102.     int     GetYear();
  103.     int     GetMonth();
  104.     int     GetDate();
  105.     LPCTSTR GetMonthString();
  106.     BOOL LeapYear ();
  107.     int GetDaysinMonth();
  108.  
  109. // Operations
  110. public:
  111.  
  112. // Overrides
  113.     // ClassWizard generated virtual function overrides
  114.     //{{AFX_VIRTUAL(CYMSelector)
  115.     public:
  116.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  117.     protected:
  118.     virtual void PreSubclassWindow();
  119.     //}}AFX_VIRTUAL
  120.  
  121. // Implementation
  122. public:
  123.     virtual ~CYMSelector();
  124.  
  125.     // Generated message map functions
  126. protected:
  127.     int m_nMonth;
  128.     int m_nYear;
  129.     int m_nDate;
  130.     //{{AFX_MSG(CYMSelector)
  131.     afx_msg void OnClicked();
  132.     //}}AFX_MSG
  133.     afx_msg LONG YMSelected(WPARAM wParam = 0, LPARAM lParam = 0);
  134.     afx_msg LONG YMAborted (WPARAM wParam = 0, LPARAM lParam = 0);
  135.  
  136.     DECLARE_MESSAGE_MAP()
  137. };
  138.  
  139. /////////////////////////////////////////////////////////////////////////////
  140. //{{AFX_INSERT_LOCATION}}
  141. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  142.  
  143. #endif // !defined(AFX_YMSELECTOR_H__12C342F1_008C_11D2_AECD_0004AC31E75C__INCLUDED_)
  144.